package com.wxf.demo3if;

import java.util.Scanner;

public class Demo3If {
	static Scanner sc = new Scanner(System.in);  //键盘录入
	public static void main(String[] args) {
		stuScore();
	}
  static int stuScore;     //定义一个学生成绩变量
	public static void stuScore() {       //创建一个stuScore的功能公共方法
		do {                                           //用do{}while()循环        
			System.out.println("请输入学生学习成绩：");        
			stuScore = sc.nextInt();                     //获取控制台信息
			if (stuScore >= 90 && stuScore <= 100) {                        //if条件判断成绩等级
				System.out.println("学习成绩优秀！");
			} else if (stuScore >= 80 && stuScore < 90) {
				System.out.println("学习成绩良好！");
			} else if (stuScore >= 70 && stuScore < 80) {
				System.out.println("学习成绩中等！");
			}else if (stuScore >= 60 && stuScore < 70) {
				System.out.println("学习成绩及格！");
			}else if (stuScore >= 0 && stuScore < 60){
				System.out.println("考试不及格，再接再厉！");
			}else {
				System.out.println("成绩输入错误，请重新输入！");
			}
		} while (stuScore < 0 || stuScore > 100);
		System.out.println("查询结束，退出！");	
	}
}
